package com.knowledgepoint.study.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.knowledgepoint.study.model.entity.KnowledgePointCategoryLevelTwo;

import java.util.List;

/**
 * 二级知识点分类 Service 接口
 */
public interface KnowledgePointCategoryLevelTwoService extends IService<KnowledgePointCategoryLevelTwo> {
    
    /**
     * 获取所有二级分类
     */
    List<KnowledgePointCategoryLevelTwo> listAll();
    
    /**
     * 根据一级分类ID获取二级分类列表
     */
    List<KnowledgePointCategoryLevelTwo> listByParentId(Integer parentId);
    
    /**
     * 检查分类名称是否已存在
     */
    boolean isNameExist(String name, Integer parentId, Integer excludeId);
    
    /**
     * 分页查询
     */
    <P extends IPage<KnowledgePointCategoryLevelTwo>> P page(P page, Wrapper<KnowledgePointCategoryLevelTwo> queryWrapper);
    
    /**
     * 根据ID获取分类详情
     */
    KnowledgePointCategoryLevelTwo getDetailById(Integer id);
    
    /**
     * 新增分类
     */
    boolean add(KnowledgePointCategoryLevelTwo category);
    
    /**
     * 更新分类
     */
    boolean update(KnowledgePointCategoryLevelTwo category);
    
    /**
     * 删除分类
     */
    boolean removeById(Integer id);
}
